import Vue from "vue";
import VueRouter from "vue-router";

import Layout from "./views/Layout.vue";
import Home from "./views/Home.vue";
import List from "./views/List.vue";
import ListA from "./views/ListA.vue";
import ListB from "./views/ListB.vue";
import Login from "./views/Login.vue";

Vue.use(VueRouter);

const router = new VueRouter({
  routes: [
    {
      path: "/",
      component: Layout,
      children: [
        {
          path: "",
          component: Home,
        },
        {
          path: "list",
          component: List,
          children: [
            {
              path: "a",
              component: ListA,
            },
            {
              path: "b",
              component: ListB,
            },
          ],
        },
      ],
    },
    {
      path: "/login",
      component: Login,
    },
  ],
});

export default router;
